package com.caipos.controller;

import com.caipos.entity.DeviceCommand;
import com.caipos.service.DeviceCommandService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RestController
@AllArgsConstructor
@RequestMapping("/test")
public class UdpTestController {

    final private DeviceCommandService deviceCommandService;

    @PostMapping("/sendMsg")
    public String sendMsg(@RequestBody DeviceCommand command) {
        deviceCommandService.createCommand(command);
        return command.toString();
    }
}
